<template>
  <div>
    <h1>登录页</h1>
    <el-button type="primary" @click="Login">登录</el-button>
    <el-button type="warning" @click="Login1">请求登录</el-button>
  </div>
</template>

<script>
export default {
  methods:{
    Login(){
      window.localStorage.setItem("username", 'demo');
      this.$router.push('/')
    },
    Login1(){
      this.$axios.get('/login')
      .then(res=>{
        console.log('res',res);
      })
      .catch(error=>{
        console.error('error',error);
      })
    }
  }
}
</script>

<style>

</style>